<template>
  <div>
    {{userlist}}<br>
    {{goodslist}}<br>

    <table>
      <tr>
        <td>店主</td>

      </tr>
      <tr v-for="i in userlist">
        <td>{{i.username}}</td>

      </tr>
    </table>
    <br>
    <br>
    <br>
    <table>
      <tr>
        <td>id</td>
        <td>店主</td>
        <td>商品名称</td>
        <td>商品价格</td>
        <td>商品图片</td>

      </tr>
      <tr v-for="(i,j) in goodslist">
        <td>{{j}}</td>
        <td>{{i.userid.username}}</td>
        <td>{{i.name}}</td>
        <td>{{i.price}}</td>
        <td>{{i.img}}</td>
      </tr>
    </table>

  </div>
</template>

<script>
export default {
  name: "day1019_show",
  data() {
    return {
      userlist:[],
      goodslist:[]

    }
  },
  methods: {
    get_user(){
      this.$axios.get('user/shopuser/').then(res=>{
        this.userlist =res.data.list
      })
    },
    get_goods(){
      this.$axios.get('user/shop/').then(res=>{
        this.goodslist =res.data.list
      })
    }
  },
  mounted() {
    this.get_user()
    this.get_goods()
  }

}
</script>

<style scoped>

</style>
